#include <iostream>
#include <pthread.h>
#include <unistd.h>

using namespace std;

// 新线程
void *threadRoutine(void *args)
{
    char *name = static_cast<char *>(args);
    while (true)
    {
        cout << name << endl;
        sleep(1);
    }
}

int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, threadRoutine, (void *)"线程1");

    while (true)
    {
    }

    return 0;
}